package com.sso.comm.util;

import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;

public class JsonHelper {
//	private static Gson gson = new GsonBuilder().create();

	public static String jsonString(Object obj) {
		return JSON.toJSONString(obj);
	}

	public static <T> T toObj(String json, TypeToken<T> type) {
		return JSON.parseObject(json,type.getType());
//		return gson.fromJson(json, type.getType());
	}
}
